package com.leap.entity.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@Schema(description = "首页展示类")
public class ArticleVO implements Serializable {

    private static final long serialVersionUID = 2L;

    @Schema(description = "文章id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long articleId;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "作者")
    private String author;

    @Schema(description = "资源地址")
    private String coverUrl;

    @Schema(description = "浏览数")
    private int browseNum;

    @Schema(description = "收藏数")
    private int likeNum;

    @Schema(description = "文章分类")
    private int category;

    @Schema(description = "视频时长")
    private Long duration;

    @Schema(description = "是否为视频类文章 0图片 1视频")
    private int isVideo;

    @Schema(description = "是否为当前用户收藏文章 1是 0否")
    private int isLiked;

    @Schema(description = "是否已发布 0未发布 1已发布")
    private int isPublish;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "文章最新改动时间")
    private LocalDateTime updateTime;

}
